*Response to "Government should take measures to reduce differences in income levels" (All data)
use "C:/Users/samsung/Desktop/Research Assistant/ESS DATA/ESS data (up to 2018).dta"
keep agea gincdif
drop if agea==.d

*cateogrize the observatons by age
recode agea (0/39=1) (40/65=2) (66/max=3), generate(agegroup)

*graph
graph bar if agegroup==1, over(gincdif) title(Young Age Group)
graph bar if agegroup==2, over(gincdif) title(Middle Age Group)
graph bar if agegroup==3, over(gincdif) title(Old Age Group)


*Response to "Differences in wealth in country, how fair" (Only 2018 data)
use "C:/Users/samsung/Desktop/Research Assistant/ESS DATA/ESS9e02"
keep agea wltdffr
drop if agea==.d

*categorize the observations by age
recode agea (0/39=1) (40/65=2) (66/max=3), generate(agegroup)

*graph
graph bar if agegroup==1, over(wltdffr) title(Young Age Group)
graph bar if agegroup==2, over(wltdffr) title(Middle Age Group)
graph bar if agegroup==3, over(wltdffr) title(Old Age Group)

*Response to "The influence gender has on the decision to recruit a person for a job" (Only 2018 data)
use "C:/Users/samsung/Desktop/Research Assistant/ESS DATA/ESS9e02"
keep agea recgndr
drop if agea==.d

*categorize the observations by age
recode agea (0/39=1) (40/65=2) (66/max=3), generate(agegroup)

*graph
graph bar if agegroup==1, over(recgndr) title(Young Age Group)
graph bar if agegroup==2, over(recgndr) title(Middle Age Group)
graph bar if agegroup==3, over(recgndr) title(Old Age Group)